﻿//
// Created by francklinson on 2021/3/21.
//

#include "person.h"

Person::Person()
{
    fname[0] = '\0';
    lname = "";
}

Person::Person(const string &ln, const char *fn)
{
    lname = ln;
    for (int i = 0; i < LIMIT && *fn != '\0'; ++i)
    {
        fname[i] = *fn++;
    }
}

void Person::Show() const
{
    for (int i = 0; i < LIMIT and fname[i] != '\0'; ++i)
    {
        cout << fname[i];
    }

    cout << " " << lname << endl;

}

void Person::FormalShow() const
{
    cout << lname << " ";
    for (int i = 0; i < LIMIT and fname[i] != '\0'; ++i)
    {
        cout << fname[i];
    }
    cout<<endl;
}

